﻿@using Library
@model List<Ecommerce.Models.HomeCaterogiesViewModel>

@{
    ViewBag.Title = Settings.GetSetting("CompanyName");
    ViewBag.Keywords = Settings.GetSetting("Keywords");
    ViewBag.Description = Settings.GetSetting("Description");
}
@section hreflangs
{
    <link rel="alternate" href="@Request.Url.Scheme://@Request.Url.Host/" hreflang="x-default" />
    @foreach (var hreflang in NOWCulture.Dictionary.Keys)
    {
        if (hreflang.Id != Settings.DefaultCulture)
        {
            <link rel="alternate" href="@Request.Url.Scheme://@Request.Url.Host/@hreflang" hreflang="@hreflang" />
        }
    }
}
@section styles
{
    @Styles.Render("~/Content/home")
}
@section scripts
{
    @(HttpContext.Current.IsDebuggingEnabled ? Scripts.Render("~/bundles/home") : Scripts.RenderFormat(@"<script src=""{0}"" async defer></script>", "~/bundles/home"))
}

@Html.Partial("_Banner")
@foreach (var item in Model)
{
    if (item.HomeProductViewModels == null || item.HomeProductViewModels.Count == 0)
    {
        continue;
    }

    var modelCulture = item.ProductCategoryCultures.SingleOrDefault(i => i.Culture == NOWCulture.CurrentCulture) ?? item.ProductCategoryCultures.First();
    <div class="categroup">
        <h2 class="catename"><a href="~/@modelCulture.Url" title="@modelCulture.Name">@modelCulture.Name.ToUpper()</a></h2>
        <div class="brandlist hidden-xs">
            <h4><a href="tivi-samsung" class="">Samsung</a></h4>
            <h4><a href="tivi-samsung" class="">Samsung</a></h4>
            <h4><a href="tivi-samsung" class="">Samsung</a></h4>
        </div>
        <h2 class="viewall hidden-xs">
            <a href="~/@modelCulture.Url" title="@modelCulture.Name">@string.Format(NOWCulture.GetString("View all {0}"), modelCulture.Name)<span> ›</span></a>
        </h2>
        <div class="clearfix"></div>
        <div class="products container-fluid">
            @foreach (var productItem in item.HomeProductViewModels)
            {
                @Html.Partial("_ProductCell", productItem)
            }
        </div>
    </div>
}
